﻿<fl:RibbonWindow x:Class="AlphaGet.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:fl="clr-namespace:Fluent;assembly=Fluent"
        xmlns:tbi="clr-namespace:Hardcodet.Wpf.TaskbarNotification;assembly=Hardcodet.Wpf.TaskbarNotification"
        xmlns:Custom="clr-namespace:AlphaGet.Controls"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        Title="AlphaGet" Icon="/AlphaGet;component/Images/icon_32.png" Height="478" Width="576"
        Closing="RibbonWindow_Closing" Loaded="RibbonWindow_Loaded">
    <DockPanel Width="Auto" Height="Auto">
        <fl:Ribbon DockPanel.Dock="Top" BackstageBrush="Gray">
            <fl:Ribbon.QuickAccessItems>
                <fl:QuickAccessMenuItem Text="Add Clipboard content" IsChecked="True">
                    <fl:Button Icon="/AlphaGet;component/Images/Toolbar/add_download.png" ToolTip="Add Clipboard content" />
                </fl:QuickAccessMenuItem>
                <fl:QuickAccessMenuItem Text="Run/Pause All"  IsChecked="True">
                    <fl:Button Icon="/AlphaGet;component/Images/Toolbar/play.png" ToolTip="Run/Pause All" />
                </fl:QuickAccessMenuItem>
            </fl:Ribbon.QuickAccessItems>
            <fl:Ribbon.BackstageItems>
                <fl:BackstageTabItem Header="Statistics">
                    
                </fl:BackstageTabItem>
                <fl:BackstageTabItem Header="Plugins">
                    <Custom:PluginsList />
                </fl:BackstageTabItem>
                <fl:BackstageTabItem Header="Settings">
                    <Custom:Settings />
                </fl:BackstageTabItem>
                <fl:BackstageTabItem Header="Help" />
                <fl:BackstageTabItem Header="About">
                    <Custom:About />
                </fl:BackstageTabItem>
                <fl:Button Icon="/AlphaGet;component/Images/Toolbar/folder_public.png" Text="Open Download Folder" Name="menuOpenDownload" Click="openFolder_Click"/>
                <fl:Button Icon="/AlphaGet;component/Images/icon_32.png" Text="Show Widget" Name="menuShowWidget" Click="showWidget_Click"/>
                <fl:Button Icon="/AlphaGet;component/Images/Toolbar/exit.png"  Text="Exit" Name="menuExit" Click="exitButton_Click" />
            </fl:Ribbon.BackstageItems>
            <fl:RibbonTabItem Header="Downloads">
                <fl:RibbonGroupBox Header="HTTP Downloads">
                    <fl:SplitButton Text="Add Download" LargeIcon="/AlphaGet;component/Images/Toolbar/add_download.png" Icon="/AlphaGet;component/Images/Toolbar/add_download.png" Size="Large" Name="addDownloadButton" Click="addDownloadButton_Click">
                        <fl:MenuItem Text="From Clipboard..." />
                        <fl:MenuItem Text="From List File..." />
                    </fl:SplitButton>
                    <fl:Button Text="Remove Selected" LargeIcon="/AlphaGet;component/Images/Toolbar/remove_down.png" Size="Large"/>
                    <fl:Button Text="Move Up" Icon="/AlphaGet;component/Images/Toolbar/up.png" Size="Middle" />
                    <fl:ComboBox Text="Sort" />
                    <fl:Button Text="Move Down" Icon="/AlphaGet;component/Images/Toolbar/down.png" Size="Middle" />
                    <fl:Button Text="Show Details" Size="Large"  LargeIcon="/AlphaGet;component/Images/Toolbar/details.png" Name="detailsButton" Click="detailsButton_Click" />
                </fl:RibbonGroupBox>
                <fl:RibbonGroupBox Header="Control">
                    <fl:Button Text="Start All" LargeIcon="/AlphaGet;component/Images/Toolbar/play.png" Size="Large" />
                    <fl:Button Text="Pause All" LargeIcon="/AlphaGet;component/Images/Toolbar/pause.png" Size="Large" />
                    <fl:Button Text="Stop All"  LargeIcon="/AlphaGet;component/Images/Toolbar/stop.png" Size="Large" />
                </fl:RibbonGroupBox>
            </fl:RibbonTabItem>
        </fl:Ribbon>
            <StatusBar  DockPanel.Dock="Bottom" Height="30" Name="statusBar1" HorizontalAlignment="Stretch">
            <StatusBarItem Content="Max Downloads:"/>
            <Custom:NumericaUpDown MinValue="0" />
            <StatusBarItem Content="Max Active Chunks (Per Down.):"/>
            <Custom:NumericaUpDown MinValue="0" />
            <StatusBarItem Content="Max Speed (KB/s):" />
            <Custom:NumericaUpDown HorizontalAlignment="Left" MinValue="0" />
        </StatusBar>
        <TreeView DockPanel.Dock="Left" Width="150"  Name="downloadList">
            <TreeViewItem Header="HTTP Downloads">
                <TreeViewItem Header="Categories" Name="categoriesItem">
                    <TreeViewItem.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="New Category" Name="menuNewCategory" Click="menuNewCategory_Click" />
                            <Separator />
                            <MenuItem Header="Clear Categories" />
                        </ContextMenu>
                    </TreeViewItem.ContextMenu>
                    <TreeViewItem Header="Uncategorized" />
                </TreeViewItem>
                <TreeViewItem Header="Completed" />
                <TreeViewItem Header="Incomplete" />
                <TreeViewItem>
                    <TreeViewItem.Header>
                        <Custom:EditableTextBlock />
                    </TreeViewItem.Header>
                </TreeViewItem>
            </TreeViewItem>
            <TreeViewItem Header="Torrents" />
        </TreeView>
        <tbi:TaskbarIcon x:Name="myNotifyIcon"
                    Visibility="Visible"
                    ToolTipText="AlphaGet"
                    IconSource="/AlphaGet;component/Images/alphaget.ico"
                    MenuActivation="RightClick"
                    PopupActivation="DoubleClick"
                    >
            <tbi:TaskbarIcon.TrayPopup>
                <Custom:Popup />
            </tbi:TaskbarIcon.TrayPopup>
            <tbi:TaskbarIcon.ContextMenu>
                <ContextMenu>
                    <MenuItem Header="Show Program Window" Name="showProgramWin"  Click="showProgramWin_Click"/>
                    <MenuItem Header="Show Widget" Name="showWidget" Click="showWidget_Click"/>
                    <MenuItem Header="Open Download Folder" Click="openFolder_Click"/>
                    <Separator />
                    <MenuItem Header="Exit" Name="exitButton" Click="exitButton_Click"/>
                </ContextMenu>
            </tbi:TaskbarIcon.ContextMenu>
        </tbi:TaskbarIcon>
        <ListView Name="currentChunksView" DockPanel.Dock="Bottom" Height="97">
            <ListView.View>
                <GridView>
                    <GridViewColumn  Header="Part" />
                    <GridViewColumn Header="Range" />
                    <GridViewColumn  Header="Size" />
                </GridView>
            </ListView.View>
        </ListView>
        <ListView Name="downloadView" ItemsSource="{Binding DownloadCollection}">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="30" Header="Icon">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Image Height="16" Width="16" Source="{Binding Icon}" />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="140" Header="Filename" DisplayMemberBinding="{Binding Filenane}"/>
                    <GridViewColumn Width="140" Header="Url" DisplayMemberBinding="{Binding Url}"/>
                    <GridViewColumn Width="140" Header="Progress">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <ProgressBar Height="20" Width="100" Value="{Binding Progress}" />
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="140" Header="Status" DisplayMemberBinding="{Binding Status}"/>
                </GridView>
            </ListView.View>
       </ListView>
    </DockPanel>
</fl:RibbonWindow>
